// 导入国际化
import { createI18n } from 'vue-i18n'
// import { useLangStoreHook } from './store'
// const langstore = useLangStoreHook()
import { useStorage } from '@vueuse/core'
const langStorage = useStorage('mylang', 'zh')
// 国际化配置
const i18n = createI18n({
  legacy: false,
  locale: langStorage.value,
  fallbackLocale: 'zh',
  messages: {
    zh: {
      message: {
        name: '长江二桥',
      },
    },
    en: {
      message: {
        name: 'yangtze river second bridge',
      },
    },
  },
})

export function setupI18N(app) {
  console.log('注册i18n')
  app.use(i18n)
}

// export default i18n
export { langStorage }
